package cn.signalpha.modules.base.controller.api;

import cn.signalpha.common.constant.AppConstant;
import cn.signalpha.core.boot.ctrl.BaseController;
import cn.signalpha.core.tool.api.R;
import cn.signalpha.modules.base.entity.Versions;
import cn.signalpha.modules.base.service.VersionsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器
 *
 * @author signalpha
 */
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_BASE_NAME + "/wap/versions")
@Api(value = "版本更新", tags = "版本更新")
public class ApiVersionsController extends BaseController {

	private final VersionsService versionsService;

	@GetMapping("/info")
	@ApiOperation(value = "最新版本", notes = "")
	public R<Versions> info() {
		return R.data(versionsService.getTopByType(1));
	}

}
